package QueryExcecution;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import queryClass.Queries;

import DB.DAOManager;

public class enterPersonalDetails {
Queries q=new Queries();
PreparedStatement pstmt=null;
	public int fillPersonalDetails(String fname,String lname,int homeno,String pass,int officeno,String outcity,String outaddress,String status,int outpin,String occupation,String panno,int mobileno,int homepin,int faxno,String email,String homecity,String dob,String homeAddress,int kyc_status){
		DAOManager dao;
		int rows =0;
		try {
			dao = new DAOManager();
			Connection conn=dao.getConnection();
			String personalDetailsQuery=q.insertPersonalDetails;
			System.out.println("hello this is adding ..................");
			pstmt=conn.prepareStatement(personalDetailsQuery);	
			pstmt.setString(1, email);
			pstmt.setString(2, pass);
			pstmt.setString(3, fname);
			pstmt.setString(4, lname);
			pstmt.setString(5, "M");
			pstmt.setString(6,"2013-06-03");
			pstmt.setInt(7, mobileno);
			pstmt.setInt(8, homeno);
			pstmt.setInt(9, faxno);
			pstmt.setInt(10, officeno);
			pstmt.setString(11, "MH");
			pstmt.setString(12, homecity);
			pstmt.setInt(13, homepin);
			pstmt.setString(14, homeAddress);
			pstmt.setString(15, panno);
			pstmt.setString(16, outaddress);
			pstmt.setInt(17, outpin);
			pstmt.setString(18, outcity);
			pstmt.setString(19, occupation);
			pstmt.setString(20, status);
			pstmt.setInt(21, kyc_status);
			System.out.println("All int's and strings setted");

			rows = pstmt.executeUpdate();


		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return rows;

		
	}////////////////  method ends  /////////////////////
}////// class ////////////////////////
